﻿using FswPdf.Models;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace FswPdf.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class TemplatesController : ControllerBase
    {
        private readonly ILogger _logger;
        public TemplatesController(ILogger<TemplatesController> logger)
        { 
            _logger = logger;
        }
        /// <summary>
        /// 获得Pdf模板
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<Msg<string[]>> Get()
        {
            return new Msg<string[]>
            {
                success = true,
                data= Helpers.PdfTemplates?.Select(p => p.Id).ToArray()
            };
        }
    }
}
